package com.lmk.mkcc;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.math.BigDecimal;
import java.util.Date;


@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "course", type = "_doc")
public class CourseDoc {
    @Id
    private Long id;
    // 课程名字
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String name;
    // 封面
    @Field(type = FieldType.Keyword)
    private String pic;
    // 适用人群
    @Field(type = FieldType.Keyword)
    private String forUser;
    // 等级
    @Field(type = FieldType.Keyword)
    private String gradeName;
    // 开课时间
    @Field(type = FieldType.Date)
    private Date startTime;
    // 结束时间
    @Field(type = FieldType.Date)
    private Date endTime;
    // 课程时长
    @Field(type = FieldType.Integer)
    private Integer totalMinute;
    // 课程上线时间
    @Field(type = FieldType.Date)
    private Date onlineTime;
    // 讲师名字
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String teacherNames;
    // 是否收费
    @Field(type = FieldType.Integer)
    private Integer charge;
    // 是否收费
    @Field(type = FieldType.Keyword)
    private String chargeName;
    // 价格
    @Field(type = FieldType.Double)
    private BigDecimal price;
    // 原价
    @Field(type = FieldType.Double)
    private BigDecimal priceOld;
    // 课程天数
    @Field(type = FieldType.Integer)
    private Integer validDays;
    // 销量
    @Field(type = FieldType.Integer)
    private Integer saleCount;
    // 浏览量
    @Field(type = FieldType.Integer)
    private Integer viewCount;
    // 评论数
    @Field(type = FieldType.Integer)
    private Integer commentCount;
    // 类型名字
    @Field(type = FieldType.Keyword)
    private String typeName;

    // 类型id
    @Field(type = FieldType.Long)
    private Long courseTypeId;
}
